﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Espaçamento entre elementos</title>
<script>

var base = prompt("digite base","");
var exponent = prompt("digite expoente","");

	function power() {
	  var result = 1;
	  

	  for (var count = 0; count < exponent; count++)
		result *= base;
	  return result;
	}

	console.log(power());
	
	var rubens = "Rubens Garcia";

	function pot(x,y){
		return Math.pow(x,y);
	}
	
	function sobrenome(sobre){
		rubens = rubens.replace(/\s/g, " " + sobre + " ");
	}
	
	alert(rubens);
	sobrenome("de Andrade");
	alert(rubens)
	

	
	
</script>

</head>

<body>



</body>

</html>

